<?php
echo $this->Form->create('Movie',array('action' => 'search'));
//echo $this->Form->input('Movie.search');
echo $this->Form->input('Movie.sTitle', array('label' => __('Title')));
echo $this->Form->input('Movie.sDirector', array('label' => __('Director')));
echo $this->Form->input('Movie.sActor', array('label' => __('Actor')));
echo $this->Form->input('Movie.sKeyword', array('label' => __('Keyword')));
echo $this->Form->input('Movie.sYear', array(
			'type' => 'datetime',
			'label' => __('Year of release'),
			'dateFormat' => 'Y',
			'timeFormat' => null,
			'empty' => true,
			'minYear' => date('Y') - 90,
			'maxYear' => date('Y'),
		));
echo $this->Form->end('Search');
?> 
<?php if (!empty($movies)): ?>
	<h3><?php echo __('Result');?></h3>
		
				<table cellpadding = "0" cellspacing = "0">
				<tr>
					<th><?php echo __('Title'); ?></th>
					<th><?php echo __('Duration'); ?></th>
					<th class="actions"><?php echo __('Actions');?></th>
				</tr>
		<?php foreach ($movies as $movie): ?>
		<tr>
					<td><?php echo $movie['Movie']['title'];?></td>
					<td><?php echo $movie['Movie']['duration'].' min'; ?></td>
					<td class="actions">
						<?php echo $this->Html->link(__('View'), array('controller' => 'movies', 'action' => 'view', $movie['Movie']['id'])); ?>
						<?php echo $this->Html->link(__('Edit'), array('controller' => 'movies', 'action' => 'edit', $movie['Movie']['id'])); ?>
						<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'movies', 'action' => 'delete', $movie['Movie']['id']), null, __('Are you sure you want to delete # %s?', $movie['Movie']['id'])); ?>
					</td>
		</tr>
		
	<?php endforeach; ?>
	</table>
<?php endif; ?>
<?php //if (!empty($movies)) var_dump($movies);?>